package logica;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

import com.thoughtworks.selenium.Selenium;

public class emulador{
	public dados.SCA sca;
	public HtmlUnitDriver driver;
	public Selenium selenium;
	
	
	public emulador() {
		sca = new dados.SCA(this.driver,this.selenium);
	}
	
	public void getServidor(String url){
		// Remove os Warnings
		LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
		this.driver = new HtmlUnitDriver();
		driver.setJavascriptEnabled(true);
		this.selenium = new WebDriverBackedSelenium(this.driver, url);		
	}
	public boolean logarSCA(String CPF, String PSW){
		return(sca.setLogin(CPF, PSW, this));
	}
	public List<String> getPrincipalDados(){
		return sca.getInfoPrincipal(this);
	}
	public ArrayList<String> getNotasVisualizar(int modoVisualizacao){
		sca.setAnoSimestre(this, "2009", "1");
		return sca.getDisciplinaNota(this, "2009", "1", modoVisualizacao);
	}
	public ArrayList<String> getFaltasEstatistica(){
		sca.setAnoSimestre(this, "2009", "1");
		return sca.getDisciplinaFalta(this, "2009", "1");
	}
	public ArrayList<String> getFaltasEstatisticaIndividual(String ano){
		sca.setAnoSimestre(this, "2009", "1");
		return sca.getDisciplinaFaltaIndividual(this, ano);
	}
}
